package study.ct.com.retrofit_rxjava.net.Cases;

import java.util.List;

import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import rx.Observable;
import study.ct.com.retrofit_rxjava.bin.TvLoginOk;
import study.ct.com.retrofit_rxjava.net.Cases.base.UseCase;
import study.ct.com.retrofit_rxjava.net.models.City;

/**
 * Created by ct on 2017/10/11 0011.
 */

public class CtLoginCase extends UseCase<CtLoginCase.Api> {

    interface Api {

        @Headers({"Content-Type: application/json","Accept: application/json"})//需要添加头
        @POST("stock/userService/login")
        Observable<TvLoginOk> login(@Body RequestBody fields);
    }

    public Observable<TvLoginOk> getLogin(RequestBody fields) {
        return ApiClient("http://wap.crunii.com:81/").login(fields)
                .compose(this.<TvLoginOk>normalSchedulers());
    }
}
